Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
"rollup-plugin-svelte" The following packages did not export their `package.json`

I am new in svelte.js. help me please to fix it

Here, when I import the swiper carousel at my .svelte file. it shows me this error which is

[rollup-plugin-svelte] The following packages did not export their package.json file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.

Screenshot of Terminal Error. Please check this

This is my code file. here is another component of a carousel slider. but I am seeing this picture when I import the swiper carousel.

<script>
    import { Swiper, SwiperSlide } from "swiper/svelte";
    import PorfolioCard from "./../components/porfolio-card.svelte";
    import SectionTitle from "./../components/sectionTitle.svelte";
    import "swiper/css";
</script>

<section id="portfolio">
    <SectionTitle title="My Portfolio" subtitle="Visit My Portfolio And Keep your feedback" />

    <div class="mt-4 px-1 px-md-3 px-lg-5">
        <Swiper>
            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>

            <SwiperSlide>
                <PorfolioCard />
            </SwiperSlide>
            
        </Swiper>
    </div>
</section>

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

TL;DR

This error can be safely ignored if it's coming from modules that don't export svelte components (eg. stream, util, is-odd; modules that export Javascript files). You can even hide it via overriding onwarn in rollup.config.js:

const onwarn = (message, warn) => {
    const ignored = {
        PLUGIN_WARNING: ['`package.json`'],
    };
    const ignoredKeys = Object.keys(ignored);
    const ignoredValues = Object.values(ignored);

    for (let i = 0, l = ignoredKeys.length; i < l; ++i) {
        const ignoredKey = ignoredKeys[i];
        const ignoredValue = ignoredValues[i];

        for (const ignoredValuePart of ignoredValue) {
            if (message.code !== ignoredKey
                || !message.toString().includes(ignoredValuePart)) {
                continue;
            }

            return;
        }
    }

    warn(message);
};

export default {
    output: {
        format: 'esm',
        name: 'app',
        dir: 'public',
    },
    onwarn,
    plugins: [
        // your plugins, eg. `svelte()`
    ],
}

Mini-explanation

It's emitted because some modules specify the files they're exporting in package.json using the exports field, but they don't include package.json itself in the field. This messes with how rollup-plugin-svelte identifies modules which export svelte components — by reading package.json (it can't import what's specifically not exported!). Here's some more technical explanation on the plugin's Github page, regarding why the plugin does things like that & the benefits of it.

about 4 years ago · Juan Pablo Isaza Report

0

There is not currently a way to silence this warning. There is however an open issue on the GitHub repo regarding it.

https://github.com/sveltejs/rollup-plugin-svelte/issues/181

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!